<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>xmpp.simplexml.NodeBuilder</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="xmpp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="xmpp-module.html">Package&nbsp;xmpp</a> ::
        <a href="xmpp.simplexml-module.html">Module&nbsp;simplexml</a> ::
        Class&nbsp;NodeBuilder
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="xmpp.simplexml.NodeBuilder-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class NodeBuilder</h1><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder">source&nbsp;code</a></span><br /><br />
Builds a Node class minidom from data parsed to it. This class used 
  for two purposes:
  <ol start="1">
    <li>
      Creation an XML Node from a textual representation. F.e. reading a
      config file. See an XML2Node method.
    </li>
    <li>
      Handling an incoming XML stream. This is done by mangling the 
      __dispatch_depth parameter and redefining the dispatch method.
    </li>
  </ol>
  You do not need to use this class directly if you do not designing 
  your own XML handler.<br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">initial_node</span>=<span class="summary-sig-default">None</span>)</span><br />
      Takes two optional parameters: &quot;data&quot; and 
      &quot;initial_node&quot;.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="destroy"></a><span class="summary-sig-name">destroy</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Method used to allow class instance to be garbage-collected.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.destroy">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#starttag" class="summary-sig-name">starttag</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">tag</span>,
        <span class="summary-sig-arg">attrs</span>)</span><br />
      XML Parser callback.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.starttag">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#endtag" class="summary-sig-name">endtag</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">tag</span>)</span><br />
      XML Parser callback.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.endtag">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#handle_data" class="summary-sig-name">handle_data</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>)</span><br />
      XML Parser callback.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.handle_data">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#handle_namespace_start" class="summary-sig-name">handle_namespace_start</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">prefix</span>,
        <span class="summary-sig-arg">uri</span>)</span><br />
      XML Parser callback.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.handle_namespace_start">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#DEBUG" class="summary-sig-name">DEBUG</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">level</span>,
        <span class="summary-sig-arg">text</span>,
        <span class="summary-sig-arg">comment</span>=<span class="summary-sig-default">None</span>)</span><br />
      Gets all NodeBuilder walking events.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.DEBUG">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getDom"></a><span class="summary-sig-name">getDom</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns just built Node.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.getDom">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="xmpp.simplexml.NodeBuilder-class.html#dispatch" class="summary-sig-name">dispatch</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">stanza</span>)</span><br />
      Gets called when the NodeBuilder reaches some level of depth on 
      it's way up with the built node as argument.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.dispatch">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="stream_header_received"></a><span class="summary-sig-name">stream_header_received</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ns</span>,
        <span class="summary-sig-arg">tag</span>,
        <span class="summary-sig-arg">attrs</span>)</span><br />
      Method called when stream just opened.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.stream_header_received">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="stream_footer_received"></a><span class="summary-sig-name">stream_footer_received</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Method called when stream just closed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.stream_footer_received">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">initial_node</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Takes two optional parameters: &quot;data&quot; and 
  &quot;initial_node&quot;. By default class initialised with empty Node 
  class instance. Though, if &quot;initial_node&quot; is provided it used 
  as &quot;starting point&quot;. You can think about it as of &quot;node 
  upgrade&quot;. &quot;data&quot; (if provided) feeded to parser 
  immidiatedly after instance init.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="starttag"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">starttag</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">tag</span>,
        <span class="sig-arg">attrs</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.starttag">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  XML Parser callback. Used internally
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="endtag"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">endtag</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">tag</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.endtag">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  XML Parser callback. Used internally
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="handle_data"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">handle_data</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.handle_data">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  XML Parser callback. Used internally
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="handle_namespace_start"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">handle_namespace_start</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">prefix</span>,
        <span class="sig-arg">uri</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.handle_namespace_start">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  XML Parser callback. Used internally
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="DEBUG"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">DEBUG</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">level</span>,
        <span class="sig-arg">text</span>,
        <span class="sig-arg">comment</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.DEBUG">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Gets all NodeBuilder walking events. Can be used for debugging if 
  redefined.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="dispatch"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">dispatch</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">stanza</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="xmpp.simplexml-pysrc.html#NodeBuilder.dispatch">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Gets called when the NodeBuilder reaches some level of depth on it's 
  way up with the built node as argument. Can be redefined to convert 
  incoming XML stanzas to program events.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="xmpp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Sat Dec 15 22:25:17 2007
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
